package jok.singleton;

/**
 * 单例模式 - 饿汉式
 */
public class Singleton2 {
	public static Singleton2 singleton;

	// 私有构造函数
	private Singleton2() {

	}

	public static Singleton2 getInstance() {
		if (singleton == null) {
			singleton = new Singleton2();
		}
		return singleton;
	}
}
